def xcheck(x, lable=''):
    print(id(x), type(x), x, lable)


b = ()
xcheck(b, 'b')

c = (1)
xcheck(c, 'c')

d = (1,)
xcheck(d, 'd')

e = tuple()
xcheck(e, 'e')

# TypeError: 'int' object is not iterable
# f = tuple(1)
# xcheck(f, 'f')

# TypeError: 'int' object is not iterable
# g = tuple(1,)
# xcheck(g, 'g')

ga = tuple([1])
xcheck(ga, 'ga')

h = tuple('hello 校长')
xcheck(h, 'h')

# TypeError: 'tuple' object does not support item assignment
# h[-2] = '市'

aa = ((1, 2), 3, (4, 5, 6))
xcheck(aa, 'aa')

bb = (('beef', 5), ('egg', 55), ('noodle', 15), ['fish', 85])
xcheck(bb, 'bb')
for xa, xb in bb:
    print(xa, xb)


bb[3].append(80)
bb[3][1] += 100
xcheck(bb, 'bb')

# AttributeError: 'tuple' object has no attribute 'append'
# bb.append(('pork', 55))

# TypeError: 'tuple' object doesn't support item deletion
# del bb[1]

for tup in bb:
    print(tup)

for tup in bb:
    print(tup[0], tup[1])



